function main(defaultParams) {
    let self = this;
    debugger
    self.$$("text_hip771").$$setValue(defaultParams.name);
    api.EXEC_FORMULA("TREE_QUERY_CHILDRENS('00c0bc5c-16c1-4745-9cf9-8ec57e23659d','" + defaultParams.id + "',['unit_id'])").then((res) => {

        let pageTableList = self.$$("page_widget_list_aqd9b6");
        let pageTableList1 = self.$$("page_widget_list_rfdb4");

        if (pageTableList && pageTableList.dataEngine && pageTableList.dataEngine.state) {
            const tableComp = pageTableList.dataEngine.state.getElement("table_27cqmi");
            const tableComp1 = pageTableList1.dataEngine.state.getElement("table_ec1ak4");
            tableComp.loading = true;
            tableComp1.loading = true;

            if (tableComp) {

                selectByUnitId(pageTableList, res.result)
                selectByUnitId(pageTableList1, res.result)

                tableComp.onRefresh();
                tableComp1.onRefresh();
            }
        }

    }).catch(err => {
        self.$message.error(err.message); // 显示错误提示信息
    });
}



/**
 * 通过部门进行过滤
 * @param {*} pageTableList
 * @param {*} unit_id
 */
function selectByUnitId(pageTableList, unit_id) {

    var members = pageTableList.dataEngine.state.layout.props.dataSet.filterData.filter.members

    members = members.filter(function (item) {
        return item.uniqueIdentify !== "unitIdFilter";
    });

    members.push({
        "uniqueIdentify": "unitIdFilter",
        field: "0bbd3112-35c4-4013-949c-22ffcf0f7b3e",
        fieldName: "unit_id",
        "fieldType": "TYPE_INTEGER",
        valueType: "Constant",
        values: unit_id || [],
        value: "",
        operate: "In", // 范围查询
        className: "Single",
        treeUnitIdFiter: "1"
    });
    var filter = {
        "combine": "And",
        "className": "List",
        "members": members
    };

    pageTableList.dataEngine.state.layout.props.dataSet.filterData = {
        "enabled": true,
        "filter": filter,
        "filterType": "FILTER",
        "rawCondition": {},
        "rawFormula": ""
    }

}


function main() {
    // 获取页面树实例
    var pageTreeEle = this.$$element("page_tree_dofgtg");
    // 获取树渲染实例
    var treeRenderEle = pageTreeEle.$$getRenderElement();
    // 获取当前树实例
    var treePanelEle = treeRenderEle.$$getTreeElement();
    // 获取第一个节点
    var firstNode = treePanelEle.$$getRootNode()[0].id;
    treePanelEle.$$clickNode({ key: firstNode });
}


